import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserView from '@/views/UserView.vue'
import AccessView from '@/views/AccessView.vue'
import SystemView from '@/views/SystemView.vue'
import Xigua from '@/views/Xigua.vue'
import DeptView from '@/views/DeptView.vue'
import Dashboard from '@/views/Dashboard.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {path: '/', redirect:'/home'},
    {path: '/home',
      component: HomeView,
      redirect:'/home/dept',
      children:[

        {
          path :'dashboard',
          // name: 'dashboard',
          component: Dashboard,
          meta: {
            title: '首页'
          }
         },
        //子路径不加斜杠
        {path: 'dept',component: DeptView,
          
      meta: {
        title: '部门管理'
      },
        },
        {path: 'user',component: UserView,
          meta: {
            title: '用户管理'
          },
        },
        {path: 'access',component:AccessView,
          meta: {
            title: '权限管理'
          },
        },
        {path: 'system',component: SystemView,
          meta: {
            title: '通道管理'
          },
        },
        {path: 'xigua',component: Xigua,
          meta: {
            title: '西瓜管理'
          },
        },

      ]

    },
   
   
  ],
})

export default router
